/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 *
 * @author James
 */
@Entity
public class InactivatedTCubeAccount implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String       id;
    private long         registeredDate;
    @OneToOne(cascade={CascadeType.PERSIST})
    private TCubeAccount theAccount;

    public InactivatedTCubeAccount() {}
    
    public InactivatedTCubeAccount(String id, TCubeAccount theAccount) {
        this.id             = id;
        this.registeredDate = System.currentTimeMillis();
        this.theAccount     = theAccount;
    }
    
    //Getters and Setters
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public long getRegisteredDate() {
        return registeredDate;
    }

    public void setRegisteredDate(long registeredDate) {
        this.registeredDate = registeredDate;
    }

    public TCubeAccount getAccount() {
        return theAccount;
    }

    public void setAccount(TCubeAccount theAccount) {
        this.theAccount = theAccount;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InactivatedTCubeAccount)) {
            return false;
        }
        InactivatedTCubeAccount other = (InactivatedTCubeAccount) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.InactivatedTCubeAccount[ id=" + id + " ]";
    }
    
}
